<?php


class  Prseen
{
public $name;
private $age;
private $study;
private $other;

    /**
     * @param mixed $age
     */
    public function setAge($age)
    {
        if ($age>0){
            $this->age = $age;
        }
    }

    /**
     * @param mixed $study
     */
    public function setStudy($study)
    {
        $this->study = $study;
    }

    /**
     * @param mixed $other
     */
    public function setOther($other)
    {
        $this->other = $other;
    }
}

class My
{
    public $name;
    private $age;
    private $study;
    private $other;


    /**
     * @return mixed
     */
    public function getName()
    {
        return $this->name;
    }
    /**
     * @param mixed $age
     */
    public function setAge($age)
    {
        if ($age>0){
            $this->age = $age;
        }
    }

    /**
     * @return mixed
     */
    public function getAge()
    {
        return $this->age;
    }
    /**
     * @param mixed $study
     */
    public function setStudy($study)
    {
        $this->study = $study;
    }

    /**
     * @return mixed
     */
    public function getStudy()
    {
        return $this->study;
    }
    /**
     * @param mixed $other
     */
    public function setOther($other)
    {
        $this->other = $other;
    }

    /**
     * @return mixed
     */
    public function getOther()
    {
        return $this->other;
    }
    function other(){
        echo "洗衣服，唱歌";
    }


}
$prseen  = new Prseen();
$prseen->name = "yoyo";
$prseen->setAge(19);
$prseen->setStudy("大学学历");
$prseen->setOther("看书，购物，亲亲，抱抱，小傲娇");
var_dump($prseen);

$my = new My();
$my->name = "沐风";
$my->setAge(21);
$my->setStudy("大学学历");
$my->setOther("看漫画，听歌，唱歌");
var_dump($my);

function My(){
    echo "大家好，我叫".$this->name."，今年：".$this->age.$this->study."我会".$this->other;
}
